package br.os.view;

import br.os.controller.OSController;

import com.sun.lwuit.Button;
import com.sun.lwuit.Form;
import com.sun.lwuit.Image;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.plaf.Border;
/**
 * OSMenu
 */
public class OSMenu extends Form{
	private OSController controller;
	private Button btManagerOS  = null;
	private Button btConfig     = null;
	private Button btLogoff     = null;
	private Button btSair       = null;
	
	/**
	 * OSMenu
	 */
	public OSMenu(OSController controller) {
		super("Ordem de Serviços");
		this.controller = controller;
		initComponents();
	}
	
	/**
	 * initComponents
	 */
	public void initComponents() {
	  btManagerOS = createButton("Gerenciar", null);
	  btConfig     = createButton("Configuracões", null);
	  btLogoff     = createButton("Logoff", null);
	  btSair       = createButton("Sair", null);
	  this.setLayout( new BoxLayout(BoxLayout.Y_AXIS));
	  this.addComponent(btManagerOS);
	  this.addComponent(btConfig);
	  this.addComponent(btLogoff);
	  this.addComponent(btSair);
	}
	/**
	 * createButton
	 */
	private Button createButton(String name, Image icon){
		Button bt = new Button(name);
		bt.setIcon(icon);
		bt.setAlignment(Button.CENTER);
		bt.getStyle().setMargin(10, 10, 20, 20);
		bt.getStyle().setBgTransparency(100);
		bt.addActionListener(controller);
		bt.getStyle().setBorder(Border.createBevelRaised());
		return bt;
	}


	/**
	 * @return the btSair
	 */
	public Button getBtSair() {
		return btSair;
	}

	/**
	 * @return the controller
	 */
	public OSController getController() {
		return controller;
	}

	/**
	 * @return the btManagerOS
	 */
	public Button getBtManagerdOS() {
		return btManagerOS;
	}


	/**
	 * @return the btConfig
	 */
	public Button getBtConfig() {
		return btConfig;
	}

	/**
	 * @return the btLogoff
	 */
	public Button getBtLogoff() {
		return btLogoff;
	}
	

}
